// 防抖 执行最后一次 
export function debounce(fn, delay = 200) {
  let timer = null
  console.log(this)
  return function() {
    let arg = arguments
    timer && clearTimeout(timer)
    timer = setTimeout(() => {
      fn.apply(this, arg)
    }, delay)
  }
}